const { defineConfig } = require('@vue/cli-service')
// 自动导入element ui的配置
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
module.exports = defineConfig({
  transpileDependencies: true,
  // plugins是引入element ui的配置
  lintOnSave: false,
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()]
      }),
      Components({
        resolvers: [ElementPlusResolver()]
      })
    ]
  }
  // devServer: {
  //   // 跨域
  //   proxy: {
  //     '/api': {
  //       // 目标路径
  //       target: 'http://localhost:3000',
  //       // 允许跨域
  //       changOrigin: true,
  //       // 重写路径
  //       pathRewrite: {
  //         '^/api': ''
  //       }
  //     }

  //   }
  // }

})
